<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    x:Class="OpenLS.UI.Themes.ButtonResources"                
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:oui="clr-namespace:OpenLS.UI"
    xmlns:ouit="clr-namespace:OpenLS.UI.Themes"
    >
<ResourceDictionary.MergedDictionaries>
    <ouit:ControlResources/>
  </ResourceDictionary.MergedDictionaries> 
  <Style TargetType ="{x:Type Button}" x:Key="RegularButton"></Style>
    <Style TargetType ="{x:Type Button}" x:Key="{x:Static oui:Styles.RibbonButtonStyleKey}" >
        <Setter Property ="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Command, Converter={x:Static oui:OfficeConverters.CommandToTextConverter}}"/>
        <Setter Property ="Margin" Value="0"/>
        <Setter Property ="Background" Value ="Transparent"/>
        <Setter Property ="Content" Value ="{Binding RelativeSource={RelativeSource Self}, Path=Command, Converter={x:Static oui:OfficeConverters.CommandToTextConverter}}"/>
        <Setter Property="oui:RibbonElement.Icon">
            <Setter.Value>
                <MultiBinding Converter="{x:Static oui:OfficeConverters.CommandToIconConverter}">
                    <Binding Path="Command" RelativeSource="{RelativeSource Self}"/>
                    <Binding Path="(oui:RibbonElement.IconProvider)" RelativeSource="{RelativeSource Self}"/>
                </MultiBinding>
            </Setter.Value>
        </Setter>
        <Setter Property ="Template">
            <Setter.Value>
                <ControlTemplate TargetType ="{x:Type Button}">
                    <Border CornerRadius="1" BorderBrush="#FF9EBBE1" BorderThickness="0" Background ="{TemplateBinding Background}" Name="buttonBorder">
                        <Grid TextElement.Foreground="{DynamicResource {x:Static oui:OfficeBrushes.TextForegroundKey}}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/> 
                            </Grid.ColumnDefinitions>
                            <ContentPresenter Name="Icon" Width="{DynamicResource {x:Static oui:Sizes.SmallWidthKey}}" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(oui:RibbonElement.Icon)}"/>
                            <ContentPresenter Name="ContentHost" Grid.Column="1" HorizontalAlignment ="Center" VerticalAlignment ="Center"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="oui:RibbonElement.Icon" Value="{x:Null}">
                            <Setter Property ="Visibility" Value ="Collapsed" TargetName ="Icon"/>
                            <Setter Property ="Width" Value ="{DynamicResource {x:Static oui:Sizes.SmallWidthKey}}" TargetName ="ContentHost"/>
                        </Trigger>
                        <Trigger Property="oui:RibbonElement.ControlState" Value="Small">
                            <Setter Property ="Visibility" Value ="Collapsed" TargetName ="ContentHost"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property ="Opacity" Value ="0.5" TargetName ="buttonBorder"/>
                        </Trigger>
                        <Trigger Property="oui:RibbonElement.IsIconVisible" Value="False">
                            <Setter Property ="Visibility" Value ="Collapsed" TargetName ="Icon"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value ="{DynamicResource {x:Static oui:OfficeBrushes.ButtonHoverBackgroundKey}}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value ="{DynamicResource {x:Static oui:OfficeBrushes.ButtonSelectedBackgroundKey}}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value ="Transparent"/>
            </Trigger>
        </Style.Triggers>
        </Style>


</ResourceDictionary>